DROP DATABASE IF EXISTS `mingyue`;

CREATE DATABASE `mingyue` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

USE `mingyue`;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
        `user_id` BIGINT ( 20 ) NOT NULL,
        `username` VARCHAR ( 64 ) NOT NULL COMMENT '用户名',
        `nickname` VARCHAR ( 64 ) NOT NULL COMMENT '用户昵称',
        `sex` CHAR ( 1 ) DEFAULT '0' COMMENT '用户性别（0男 1女 2未知）',
        `password` VARCHAR ( 255 ) NOT NULL COMMENT '密码',
        `phone` VARCHAR ( 32 ) DEFAULT NULL COMMENT '手机号码',
        `email` VARCHAR ( 32 ) DEFAULT NULL COMMENT '用户邮箱',
        `avatar` VARCHAR ( 255 ) DEFAULT NULL COMMENT '头像',
        `lock_flag` CHAR ( 1 ) DEFAULT '0' COMMENT '0-正常，9-锁定',
        `del_flag` CHAR ( 1 ) DEFAULT '0' COMMENT '0-正常，1-删除',
        `create_time` datetime DEFAULT NULL COMMENT '创建时间',
        `update_time` datetime DEFAULT NULL COMMENT '修改时间',
        `create_by` VARCHAR ( 64 ) DEFAULT NULL COMMENT '创建者',
        `update_by` VARCHAR ( 64 ) DEFAULT NULL COMMENT '更新人',
        PRIMARY KEY ( `user_id` ),
        KEY `user_idx1_username` ( `username` )
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC COMMENT = '用户表';
-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES (1, 'mingyue', '明月', '0', '123456', '13260718262', NULL, NULL, '0', '0', NULL, NULL, NULL, NULL);
COMMIT;


SET FOREIGN_KEY_CHECKS = 1;
